package com.cj.mobile.iabp.mvp.ui.activity;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.github.chrisbanes.photoview.PhotoView;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.cj.mobile.iabp.R;
import com.cj.mobile.iabp.app.global.Constant;

import butterknife.BindView;

/**
 * 包名： com.zqw.mobile.aptitude.mvp.ui.activity
 * 对象名： PhotoViewActivity
 * 描述：图片查看器
 * 作者： wly
 * 邮箱：wangliyang206@163.com
 * 创建日期： 2018/8/16 17:18
 */

public class PhotoViewActivity extends BaseActivity {

    @BindView(R.id.photo_view)
    PhotoView photoView;

    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {

    }

    @Override
    public int initView(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_photo_view;
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {
        String url = getIntent().getStringExtra(Constant.IMAGE_URL);
        Glide.with(getApplicationContext())
                .load(url)
                .error(R.mipmap.mis_default_error)
                .into(photoView);

        // 点击关闭界面
        photoView.setOnClickListener(v -> onBackPressed());
    }
}
